:: t -> t1 -> t -package:parallel

const x y always evaluates to x, ignoring its second argument.
>>> const 42 "hello"
42
>>> map (const 42) [0..3]
[42,42,42,42]
const x is a unary function which evaluates to x for all inputs.
>>> const 42 "hello"
42
>>> map (const 42) [0..3]
[42,42,42,42]
const x is a unary function which evaluates to x for all inputs. For instance,
>>> map (const 42) [0..3]
[42,42,42,42]
const x is a unary function which evaluates to x for all inputs.
>>> const 42 "hello"
42
>>> map (const 42) [0..3]
[42,42,42,42]
An alias of const, this upgrades a handler that does not accept LambdaContext as its first curried argument to one that does. This allows us to use other combinators to construct a lambda runtime that accepts a handler that ignores LambdaContext. In the example below, we reconstruct pureRuntime without actually using it. @ {-# LANGUAGE NamedFieldPuns, DeriveGeneric #-} module Main where import AWS.Lambda.Runtime (pureRuntimeWithContext) import AWS.Lambda.Combinators (withoutContext) import Data.Aeson (FromJSON) import GHC.Generics (Generic) data Named = Named { name :: String } deriving Generic instance FromJSON Named myHandler :: Named -> String myHandler (Named { name }) = "Hello, " ++ name main :: IO () main = (pureRuntimeWithContext . withoutContext) myHandler @
This is the pure functional matching operator. If the target cannot be produced then some empty result will be returned. If there is an error in processing, then error will be called.
raise a number to a non-negative integral power
The value of seq a b is bottom if a is bottom, and otherwise equal to b. In other words, it evaluates the first argument a to weak head normal form (WHNF). seq is usually introduced to improve performance by avoiding unneeded laziness. A note on evaluation order: the expression seq a b does not guarantee that a will be evaluated before b. The only guarantee given by seq is that the both a and b will be evaluated before seq returns a value. In particular, this means that b may be evaluated before a. If you need to guarantee a specific order of evaluation, you must use the function pseq from the "parallel" package.
The value of seq a b is bottom if a is bottom, and otherwise equal to b. In other words, it evaluates the first argument a to weak head normal form (WHNF). seq is usually introduced to improve performance by avoiding unneeded laziness. A note on evaluation order: the expression seq a b does not guarantee that a will be evaluated before b. The only guarantee given by seq is that the both a and b will be evaluated before seq returns a value. In particular, this means that b may be evaluated before a. If you need to guarantee a specific order of evaluation, you must use the function pseq from the "parallel" package.
The value of seq a b is bottom if a is bottom, and otherwise equal to b. seq is usually introduced to improve performance by avoiding unneeded laziness. A note on evaluation order: the expression seq a b does not guarantee that a will be evaluated before b. The only guarantee given by seq is that the both a and b will be evaluated before seq returns a value. In particular, this means that b may be evaluated before a. If you need to guarantee a specific order of evaluation, you must use the function pseq from the "parallel" package.
The value of seq a b is bottom if a is bottom, and otherwise equal to b. In other words, it evaluates the first argument a to weak head normal form (WHNF). seq is usually introduced to improve performance by avoiding unneeded laziness. A note on evaluation order: the expression seq a b does not guarantee that a will be evaluated before b. The only guarantee given by seq is that the both a and b will be evaluated before seq returns a value. In particular, this means that b may be evaluated before a. If you need to guarantee a specific order of evaluation, you must use the function pseq from the "parallel" package.